package com.peakmain.wanandroid.netmodule.net.http;

import com.google.gson.JsonObject;

import okhttp3.Call;
import okhttp3.Headers;
import okhttp3.Response;

/**
 * author ：Peakmain
 * version : 1.0
 * createTime：2020/2/22
 * mail:2726449200@qq.com
 * describe：服务器返回错误码
 */
public class ResponseCode {
    //前台好后台约定的错误码
    public static final int CODE_SUCCESS = 0;//请求成功
    public static final int CODE_ERROR = 1;//失败
    public static final int CODE_TOKEN_FAILURE = 2;//token失效
    //Http 标准的错误码
    public static final int HTTP_CODE_200 = 200;// 调用接口成功
    public static final int HTTP_CODE_404 = 404;//服务器找不到给定的资源(url 不正确等)
    public static final String HTTP_CODE_500 = "500";//内部错误(服务器没有正常运行等)
    public static final int NETWORK_ERROR = -1;//网络错误
    public static final int NETWORK_TIMEOUT = -2;//网络超时

    public int code;      //http code
    public String msg;
    private String responseStr;//后台返回Json 数据(String类型)
    private JsonObject responseJson;// 后台返回Json 数据(Json类型)
    private boolean responseNull;   //http是否无响应
    private boolean timeout;        //是否请求超时
    private String message;         //http响应消息
    private String response;        //http响应结果
    private Headers headers;        //http headers
    private Response httpResponse;
    private Call call;

    private PagerBean pagerBean;



    public String getResponseStr() {
        return responseStr;
    }

    public void setResponseStr(String responseStr) {
        this.responseStr = responseStr;
    }


    public JsonObject getResponseJson() {
        return responseJson;
    }

    public void setResponseJson(JsonObject responseJson) {
        this.responseJson = responseJson;
    }

    public Call getCall() {
        return call;
    }

    public void setCall(Call call) {
        this.call = call;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public PagerBean getPagerBean() {
        return pagerBean;
    }

    public void setPagerBean(PagerBean pagerBean) {
        this.pagerBean = pagerBean;
    }
}
